﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FL.Bussiness;
using FL.Common;
using FL.DBModule;
using FL.DBModule.Sys;
using FL.Lite;


namespace FL.Web.BackEnd.Controllers
{
    //[RequiresAuthentication]
    public class BasePageController : Controller
    {
        /// <summary>
        /// 当前用户
        /// </summary>
        public SysUser CurreentUser
        {
            get
            {
                return System.Web.HttpContext.Current.Session["User"] as SysUser;
            }
        }


        public string GetQueryString(string name,string defaultValue="")
        {
            return string.IsNullOrEmpty(Request.QueryString[name]) ? defaultValue : Request.QueryString[name];
        }

        public string GetFormString(string name, string defaultValue = "")
        {
            return string.IsNullOrEmpty(Request.Form[name]) ? defaultValue : Request.Form[name].ToString();
        }

        public int GetQueryInt(string name, int defaultValue = 0)
        {
            return string.IsNullOrEmpty(Request.QueryString[name]) ? defaultValue : int.Parse(Request.QueryString[name]);
        }

        public int GetFormInt(string name, int defaultValue = 0)
        {
            return string.IsNullOrEmpty(Request.Form[name]) ? defaultValue : int.Parse(Request.Form[name].ToString());
        }


	}

}